
const app = getApp()
const $api = require('../../utils/api.js').API;

Page({
    data: {
        list:{}
    },
    onLoad:function(){
        this.getlist();
    },
    onShow: function(){
        
    },
    getlist: function(){
        var that = this
        var data ={}
        $api.get('agent/list',data).then(res => {
            console.log(res)
            if(res.data.code == 1){
                that.setData({
                    list:res.data.data
                })
            }
        }).catch(err => {
            //请求失败
            //console.log('error',err);
        })
    },
    goinfo:function(e){
        var id = e.currentTarget.dataset.id
        wx.navigateTo({
            url:'/pages/agent/rcode?id='+id
        })
    },
    onShareAppMessage: function() {
        return {
            title: "天意美业直通车",
            path: "/pages/index/index?puid="+wx.getStorageSync('uid')
        };
      }
});